<template>
  <div class="search-box">
    <slot></slot>
    <div class="search-box__button-wrap">
      <!-- v-if="getOperation('list')"-->
      <el-button size="small" @click="search" class="search-box__button" v-if="searchFlag">查询</el-button>
      <slot name="actions"></slot>
    </div>
  </div>
</template>

<script>
  export default {
    name: "XtSearch",
    methods: {
      search(event) {
        this.$emit("search", event);
      }
    },
    props: {
      searchFlag: {
        type: Boolean,
        default: true
      }
    }
  };
</script>

<style lang="scss" scoped>
  .search-box{
    display: flex;
    background-color: #eee;
    margin-bottom: 8px;
    & .search-box__input{
      width: 230px;
      margin: 2px 2px 2px;
    }
    & .search-box__button-wrap{
      display: flex;
      align-items: center;
      margin-left: 8px;
    }
  }
</style>

